import request from '@/utils/request'

// 查询材料库列表
export function listMaterialLibrary(query) {
  return request({
    url: '/business/materialLibrary/list',
    method: 'get',
    params: query
  })
}

// 查询材料库详细
export function getMaterialLibrary(id) {
  return request({
    url: '/business/materialLibrary/' + id,
    method: 'get'
  })
}

// 新增材料库
export function addMaterialLibrary(data) {
  return request({
    url: '/business/materialLibrary',
    method: 'post',
    data: data
  })
}

// 修改材料库
export function updateMaterialLibrary(data) {
  return request({
    url: '/business/materialLibrary',
    method: 'put',
    data: data
  })
}

// 删除材料库
export function delMaterialLibrary(id) {
  return request({
    url: '/business/materialLibrary/' + id,
    method: 'delete'
  })
}

// 查询部门列表（排除节点）
export function listMaterialLibraryExcludeChild(deptId) {
  return request({
    url: '/business/materialLibrary/list/exclude/' + deptId,
    method: 'get'
  })
}